from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.sql import func
from .base import Base


class ActionItem(Base):
    __tablename__ = "action_items"
    __table_args__ = {
        "comment": "执行表",
    }
    id = Column(Integer, primary_key=True, comment="行动项主键", autoincrement=True)
    meeting_id = Column(Integer, ForeignKey("meetings.id"), nullable=False, index=True, comment="所属会议")
    text = Column(String(2000), nullable=False, comment="行动项内容")
    assignee = Column(String(255), nullable=True, comment="负责人（用户名或 id）")
    due_date = Column(DateTime, nullable=True, comment="截止时间")
    status = Column(String(50), nullable=False, default="open", comment="状态 open/in-progress/done")
    created_at = Column(DateTime, server_default=func.now(), comment="创建时间")
